import { ref } from "vue";
import { parseTime } from "@/utils/ruoyi";
import type { AvueCrudOption } from "@smallwei/avue";

export default function () {
  const option: AvueCrudOption = {
    rowKey: "menuId",
    align: "center",
    index: true,
    indexLabel: "序号",
    delBtn: false,
    searchShow: false,
    column: [
      {
        prop: "typeName",
        label: "类型名称",
        search: true,
        rules: [
          {
            required: true,
            message: "请输入类型名称",
          },
        ],
      },
      {
        prop: "createTime",
        label: "创建时间",
        formatter: (row: any) => {
          return parseTime(row.createTime);
        },
      },
    ],
  };

  return ref(option);
}
